Additionally, this ledger is stored and transmitted by a network of mutually

distrusting nodes.

As a result, the blockchain has a number of different uses for hash functions

and the integrity protection that they provide.

Some of the most common uses of the hash function in blockchain include:

Digital signatures: Hash functions are a vital part of digital signature

algorithms summarizing the data to a compact value while preserving

its integrity. Digital signatures are used for preserving data integrity

and authentication for blockchain transactions and blocks.

Merkle trees: The Merkle tree uses hash functions to ensure that it is

infeasible to find two Merkle trees with the same root hash

summarized by a list of transactions contained within a block into a

single value within a blockchain header. The integrity of the

transactions contained within the block’s body is protected as well as

by storing the root hash within a block header and protecting the

integrity of the block header.

Proof-of-work (PoW) consensus: The PoW consensus algorithm

defines a valid block as one whose header has a hash value less than a

given threshold. Hash function collision resistance is essential here

since it ensures that finding a valid block is difficult.

The blockchain’s “ chains” : The hash of the previous block header

within its header is contained by each block in the blockchain, which

ensures that changing a single block in the blockchain without

detection is impossible. Modifying one block in the chain requires

generating new versions of every following block as well, increasing

the difficulty and helping to preserve the integrity of the blockchain’s

digital ledger.

Hash function security for blockchain

Hash functions are vital to protect the immutability of the digital ledger. If

the hash function used by a blockchain is broken, then an attacker could

find collisions for crucial hash values (such as the block’s chains or a

Merkle tree’s values). This would enable malicious nodes to more easily

rewrite the history of the blockchain network and cause a blockchain